using UnityEngine;
using UnityEngine.SceneManagement;

public class controllerLoadingMenu : MonoBehaviour
{
	public UITexture background;

	private void Awake()
	{
		SetBackgroundTexture();
	}

	private void Start()
	{
		if (FyberWrapper.instance != null)
		{
			FyberWrapper.instance.ShowAds(FyberWrapper.instance.leaveLocation);
			FyberWrapper.instance.leaveLocation = ADSLocation.None;
		}
		Resources.UnloadUnusedAssets();
		SceneManager.LoadScene("Lobby");
	}

	private void SetBackgroundTexture()
	{
		string text = controllerLoadingGame.typeGame.ToString().ToLower();
		text = BCWStorage.Get<string>(settings.keyForShowLoadingSprite);
		Texture texture = Resources.Load<Texture>("TextureForPreload/loaders/" + text);
		if (texture != null && background != null)
		{
			background.mainTexture = texture;
		}
	}
}
